<!DOCTYPE html>
<html lang="en">
<head>
<!--    metaphysics-->
    <meta charset="UTF-8">
    <title>首页</title>
    <style>
        body{
            width:960px;
            margin:0 auto;


        }

        .n1{
            margin:20px 20px;
            font-size:20px;


        }
        .n1>a{
            text-decoration: none;
            font:bold 30px Arial;
            vertical-align:bottom

        }
        .i1{
         font-size: 20px;
        }
         .nav {
            float: right;
            margin-top: 20px;
        }
    </style>
</head>
<body>
<div class="nav">
    {% if request.session.username %}
    {{request.session.username}}
    <a href="/logout/">注销</a>
    {% else %}
    <a href="/login/">登录</a>&nbsp
    {% endif %}
    <a href="">注册</a>
</div>

    <h2>千峰教育学科资料</h2>

    <hr>
    {% for subject in subjects %}
    <div class="subject">
        <p class="n1">
            <a href="/teachers/?sno={{ subject.no }}">{{subject.name}}</a>
            &nbsp;&nbsp;
            {% if subject.is_hot %}
            <img src="/static/images/hot-icon.png" >
            {% endif %}
        </p>
        <p class="i1">{{subject.intro}}</p>

    </div>
    {% endfor %}

<!--    django模板页，可以使用django的语法指令来生产动态页-->
<!--    <ul>-->
<!--        {% for fruit in fruits %}-->
<!--        <li>{{ fruit }}</li>-->
<!--        {% endfor %}-->
<!--    </ul>-->

</body>
</html>